import { Pagination, PageResult } from '@/types/global'
import { http } from '@/utils/http'

export interface Dept {
  id: number
  name: string
  pid: number
  address: string
}

type MyParams = Pagination & { subType?: string } // 定义类型 类型是Pagination的属性 + subType属性

/** GET 请求 */
export const getDeptListPageApi = (data?: Pagination) => {
  return http.get<PageResult<Dept>>('/dept/dept-drop-list', data)
}

export const getDeptListApi = () => {
  return http.get<Dept[]>('/dept/dept-drop-list')
}
